#ifndef _FILLEDPOLYGONS_H_
#define _FILLEDPOLYGONS_H_

#pragma once
#include "..\SDLSample.h"
#include "SDL.h"
#include "SDL_gfxPrimitives.h" 
#include <list>
#include <vector>
#include <iostream>

using namespace std;

class FilledPolygons : public SDLSample
{
public:
	FilledPolygons(void);
	virtual ~FilledPolygons(void);
	void run(void);
	void drawLine(int, int, int, int, Uint32);
	int absoluteValue(int);
	int round(float);
	void putPixel(int, int, Uint32);
	void fillPolygon(void);
private:
	SDL_Surface* screen;
	class Polygon
	{
	public:
		Polygon(void);
		~Polygon(void);
		class Point
		{
		public:
			Point(int, int);
			~Point(void);
			int getX(void);
			int getY(void);
			bool equals(Point*, int);
			int absoluteValue(int);
		private:
			int xpos;
			int ypos;
		};
		void add(Point*);
		bool isEmpty(void);
		bool isClosed(void);
		Point* getFirstPoint(void);
		Point* getLastPoint(void);
		list<Point*> getPoints(void);
		int getPointsCount(void);
		vector<int> getPointsXCoordinate(void);
		vector<int> getPointsYCoordinate(void);
	private:
		list<Point*> points;
		bool _isClosed;
	};
	Polygon* polygon;
	static int WINDOW_WIDTH;
	static int WINDOW_HEIGHT;
};

#endif
